﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ProjectRoughWork
{
    class StateChangeListener : EventListener
    {
        /// <summary>
        /// Default Constructor. Currently does not do anything
        /// </summary>

        public StateChangeListener() : base()
        {

        }

        /// <summary>
        /// Handles the "Change Game State" event
        /// </summary>
        /// <param name="eventData">Event to be processed</param>

        public override void VHandleEvent(IEventData eventData)
        {
            base.VHandleEvent(eventData);

            if (eventData.VGetEventType().Equals("ChangeGameState"))
            {
                EventChangeGameState stateEvt = (EventChangeGameState)eventData;

                ((ProjectGameLogic)ProjectGameLogic.GetInstance()).ChangeState(stateEvt.NewState);
            }
        }

    }
}
